home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
YERK
/
SUPPLEME
/
UNSUPPOR
/
UTILITIE
/
PRINTALL
< prev
next >
Wrap
Text File
|
1986-10-17
|
1KB
|
57 lines
\ printall -- prints all text files on a volume
\ 1/23/85 SSG Version 1.0
\ 2/12/85 SSG Prints files in alphabetical order
\ 2/15/85 SSG Made filenames case insensitive
\ 1/07/86 cdn Integrated with qPrint
Decimal
// vol
// iwCtl
SCON SYSNAME "System"
100 ordered-col FNames \ to contain indices of filenames
0 variable tempFN 60 allot \ filename buffer
: .st sp@ s0 swap 624 count type (.stack) ;
\ ( addr -- ) Converts a str255-format string to uppercase.
: >ucStr255
count swap +base swap >uc ;
\ Compares two filenames.
: FnComp { e1 e2 -- result }
e2 getidxfile drop pad tempFN 64 cmove
e1 getidxfile drop
pad >ucStr255
tempFN >ucStr255
pad count tempFN count $= ;
\ Sorts indices of filenames in FNames.
: getFNs
CR ." Reading/Sorting disk directory╔ "
filecount 0 DO i 1+ add: FNames LOOP
ixAddr: FNames size: FNames 'c FnComp sort ;
\ ( -- ) Prints all text files on the default volume.
: printAll pinit
picaProp \ Set font to Pica proportional .
new: loadFile
getFNs
size: FNames 0
DO i at: FNames getidxfile
pad count sysname s= not \ file = System ?
IF clear: topFile
pad count name: topFile
openReadOnly: topFile ?error 132
GetFileInfo: topFile drop
GetType: topFile txType =
IF CR ." Printing: " pad count type
qPrint
THEN
close: topFile drop
THEN
LOOP
remove: loadFile ;
: printext external printall ;
: printint sony printall ;